package com.example.mykotilin.room2

import androidx.room.Dao
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface ScheduleDao {
    //根据倒叙查找所有数据
    @Query("SELECT * FROM schedule ORDER BY arrival_time ASC")
    fun  getAll():Flow<List<Schedule>>

    @Query("SELECT * FROM schedule WHERE stop_name = :stopName ORDER BY arrival_time ASC")
    fun getByStopName(stopName: String) : Flow<List<Schedule>>
}